package com.atguigu.service.impl;

import com.atguigu.dao.UserDao;
import com.atguigu.dao.impl.UserDaoImpl;
import com.atguigu.domain.User;
import com.atguigu.service.UserService;

/**
 * @author dl
 * @create 2020-04-18-16:02
 */
public class UserServiceImpl implements UserService {

	private UserDao userDao = new UserDaoImpl();

	@Override
	public User userLogin(User user) {
		return userDao.getUserByNameAndPassword(user);
	}

	@Override
	public boolean userRegister(User user) {
		return userDao.registerUser(user);
	}

	@Override
	public boolean existsName(String username) {
		User user = userDao.existsName(username);
		return user == null;
	}
}
